package com.hc.server.actions;

import org.json.JSONException;

import com.hc.server.Error;
import com.hc.server.IAction;
import com.hc.server.Request;
import com.hc.server.Response;

/**
 * 根据城市获取关键字
 * @author xujh
 *
 */
public class GET_KEYS implements IAction {

	private static final String CITY = "CITY";
	private static final String HOTEL = "HOTEL";
	private static final String TRAVEL = "TRAVEL";
	private static final String TICKET = "TICKET";
	private static final String SPECIALITY = "SPECIALITY";
	private static final String REPAST = "REPAST";
	
	@Override
	public void execute(Request req, Response resp) {
		String city;
		try {
			city = req.getStrArg(CITY);
		} catch (JSONException e) {
			resp.setErrResp(Error.INVALID_ARGS_ERR_CD, Error.INVALID_ARGS_ERR_MSG);
			return;
		}
		//酒店和旅游线路根据城市返回关键字
//		switch (city) {
//			case City.CHENGDU:
//				break;
//			default:
//				resp.setErrResp(Error.CITY_NOFOUND_ERR_CD, Error.CITY_NOFOUND_ERR_MSG);
//				break;
//		}
		
		String ticketKeys = "['娱乐','景区','表演']";
		resp.appendRespContent(TICKET, ticketKeys);
		String repastKeys = "['小吃','中餐','火锅','西餐']";
		resp.appendRespContent(REPAST, repastKeys);
		String speKeys = "['珠宝','玉器','饰品','美食']";
		resp.appendRespContent(SPECIALITY, speKeys);
	}

}
